<!DOCTYPE html>
<html>

<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="../bootstrap-5.1.3-dist/css/bootstrap.css" rel="stylesheet">
  <script src="../bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js"></script>
</head>

<body class="container">
  <h3 align="center">弹窗的4个方向</h2>
    <button type="button" class="btn btn-lg btn-danger ml-5" data-bs-toggle="popover" data-bs-placement="left"
      title="雪晴晚望" data-bs-content="倚杖望晴雪">向左</button>
    <button type="button" class="btn btn-lg btn-danger ml-5" data-bs-toggle="popover" data-bs-placement="right"
      title="雪晴晚望" data-bs-content="倚杖望晴雪">向右</button>
    <div class="mt-5 mb-5">
      <hr>
    </div>
    <button type="button" class="btn btn-lg btn-danger ml-5 " data-bs-toggle="popover" data-bs-placement="top"
      title="雪晴晚望" data-bs-content="倚杖望晴雪">向上</button>
    <button type="button" class="btn btn-lg btn-danger ml-5" data-bs-toggle="popover" data-bs-placement="bottom"
      title="雪晴晚望" data-bs-content="倚杖望晴雪">向下</button>

    <script>
      var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
      var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
        return new bootstrap.Popover(popoverTriggerEl)
      })
    </script>

</body>

</html>